<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
        xmlns:rdf   ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:earl  ="http://www.w3.org/ns/earl#"
        xmlns       ="http://www.w3.org/1999/xhtml"
        xmlns:dc    ="http://purl.org/dc/elements/1.1/"
        xmlns:xsl   ="http://www.w3.org/1999/XSL/Transform"
        xmlns:tests ="http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/tests.html"
        version="1.0">
    <xsl:param  name="project" />
    <xsl:param  name="url" />
    <xsl:param  name="date"/>
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">
        <rdf:RDF>
            <xsl:apply-templates select="/tests:Results/tests:Result"/>
        </rdf:RDF>
    </xsl:template>
    <xsl:template match="tests:Result">
        <earl:Assertion>
            <earl:subject rdf:resource="{$url}"/>
            <earl:test rdf:resource="http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#{@id}"/>
            <earl:assertedBy rdf:resource="http://metacognition.info/gsp_validation/validator"/>
            <earl:result>
                <earl:TestResult>
                    <xsl:if test="@result!='passed'">
                        <earl:info>
                            <xsl:value-of select="text()"/>
                        </earl:info>
                    </xsl:if>
                    <xsl:element name="earl:outcome" namespace="http://www.w3.org/ns/earl#">
                        <xsl:attribute name="rdf:resource">
                            <xsl:choose>
                                <xsl:when test="@result='passed'">http://www.w3.org/ns/earl#pass</xsl:when>
                                <xsl:otherwise>http://www.w3.org/ns/earl#fail</xsl:otherwise>
                            </xsl:choose>
                        </xsl:attribute>
                    </xsl:element>
                    <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
                        <xsl:value-of select="$date"/>
                    </dc:date>
                </earl:TestResult>
            </earl:result>
        </earl:Assertion>
    </xsl:template>
</xsl:stylesheet>